<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>结构伪类选择器示例</title>
    <style type="text/css">
        ul li:first-child {
            background-color: green;
        }
        ul li:last-child {
            background-color: red;
        }
        ul li:nth-child(odd) {
            background-color: lightgray;
        }
        ul li:nth-of-type(2) {
            font-weight: bold;
        }
        ul li:last-of-type {
            font-size: 20px;
        }
    </style>
</head>
<body>
    <ul>
        <li>项1</li>
        <li>项2</li>
        <li>项3</li>
        <li>项4</li>
        <li>项5</li>
        <li>项6</li>
    </ul>
</body>
</html>